package com.usian.controller;

import com.usian.pojo.SearchItem2;
import com.usian.service.SearchItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/service/searchItem")
public class SearchItemServiceController {
    @Autowired
    private SearchItemService searchItemService;
    //导入商品数据到索引库
    @RequestMapping("/importAll")
    boolean importAll(){
        return searchItemService.importAll();
    }
    //商品搜索
    @RequestMapping("/list")
    List<SearchItem2> selectByq(@RequestParam String q, @RequestParam Long page, @RequestParam Integer pageSize){
        return searchItemService.selectByq(q,page,pageSize);
    }
}
